import { Component, Vue } from "vue-property-decorator";
import { State, Mutation, Action } from "vuex-class";
import { Page } from "@/store/interface"; // 引用接口的定义类型

@Component
export class Tools extends Vue {
    /**
     * 公共的加载loading方法
     */
    @Mutation("LOADINF_SHOW")
    public commLoading!: (state: boolean) => void;
}

/**
 * 分页model
 */
@Component
export class Base extends Tools {
    // 初始化数据
    pageInfo: Page = {
        pageNumber: 1,
        pageSize: 10
    };

    pageNumChange(num: number) {
        this.pageInfo.pageNumber = num;
    }

    pageSizeChange(num: number) {
        this.pageInfo.pageSize = num;
    }
}
